home *** CD-ROM | disk | FTP | other *** search
/ 500 MB Nyheder Direkte fra Internet 9 / 500 MB nyheder direkte fra internet CD 9.iso / start / zipped / dos / novell / sdk.exe / SDK / INCLUDE / NWCONNEC.H < prev    next >
C/C++ Source or Header  |  1995-05-09  |  8KB  |  296 lines

  1. /******************************************************************************
  2.  
  3.   $Workfile:   nwconnec.h  $
  4.   $Revision:   1.26  $
  5.   $Modtime::   08 May 1995 16:33:38                        $
  6.   $Copyright:
  7.  
  8.   Copyright (c) 1989-1995 Novell, Inc.  All Rights Reserved.                      
  9.  
  10.   THIS WORK IS  SUBJECT  TO  U.S.  AND  INTERNATIONAL  COPYRIGHT  LAWS  AND
  11.   TREATIES.   NO  PART  OF  THIS  WORK MAY BE  USED,  PRACTICED,  PERFORMED
  12.   COPIED, DISTRIBUTED, REVISED, MODIFIED, TRANSLATED,  ABRIDGED, CONDENSED,
  13.   EXPANDED,  COLLECTED,  COMPILED,  LINKED,  RECAST, TRANSFORMED OR ADAPTED
  14.   WITHOUT THE PRIOR WRITTEN CONSENT OF NOVELL, INC. ANY USE OR EXPLOITATION
  15.   OF THIS WORK WITHOUT AUTHORIZATION COULD SUBJECT THE PERPETRATOR TO
  16.   CRIMINAL AND CIVIL LIABILITY.$
  17.  
  18.  *****************************************************************************/
  19.  
  20. #if ! defined ( NWCONNECT_H )
  21. #define NWCONNECT_H
  22.  
  23. #if ! defined ( NWCALDEF_H )
  24. # include "nwcaldef.h"
  25. #endif
  26.  
  27. #include "npackon.h"
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32.  
  33. #define C_SNAMESIZE 48
  34. typedef struct
  35. {
  36.   NWCONN_HANDLE   connID;
  37.   nuint16         connectFlags;
  38.   nuint16         sessionID;
  39.   NWCONN_NUM      connNumber;
  40.   nuint8          serverAddr[12];
  41.   nuint16         serverType;
  42.   nstr8           serverName[C_SNAMESIZE];
  43.   nuint16         clientType;
  44.   nstr8           clientName[C_SNAMESIZE];
  45. } CONNECT_INFO;
  46.  
  47. typedef struct
  48. {
  49.    nuint32  systemElapsedTime;
  50.    nuint8   bytesRead[6];
  51.    nuint8   bytesWritten[6];
  52.    nuint32  totalRequestPackets;
  53. } CONN_USE;
  54.  
  55. typedef struct tNWINET_ADDR
  56. {
  57.   nuint8   networkAddr[4];
  58.   nuint8   netNodeAddr[6];
  59.   nuint16  socket;
  60.   nuint16  connType;  /* 3.11 and above only: 0=not in use, 2=NCP, 3=AFP */
  61. } NWINET_ADDR;
  62.  
  63. #define CONNECTION_AVAILABLE            0x0001
  64. #define CONNECTION_PRIVATE              0x0002  /* obsolete */
  65. #define CONNECTION_LOGGED_IN            0x0004
  66. #define CONNECTION_LICENSED             0x0004
  67. #define CONNECTION_BROADCAST_AVAILABLE  0x0008
  68. #define CONNECTION_ABORTED              0x0010
  69. #define CONNECTION_REFUSE_GEN_BROADCAST 0x0020
  70. #define CONNECTION_BROADCASTS_DISABLED  0x0040
  71. #define CONNECTION_PRIMARY              0x0080
  72. #define CONNECTION_NDS                  0x0100
  73. #define CONNECTION_PNW                  0x4000
  74. #define CONNECTION_AUTHENTICATED        0x8000  /* obsolete */
  75.  
  76. /* the following are for NWGetConnInfo */
  77. /* ALL is VLM, OS2 and NT - NOT NETX */
  78. #define NW_CONN_TYPE           1   /* returns nuint16  (VLM) */
  79. #define NW_CONN_BIND      0x0031
  80. #define NW_CONN_NDS       0x0032
  81. #define NW_CONN_PNW       0x0033
  82. #define NW_AUTHENTICATED       3  /* returns nuint16  = 1 if authenticated (ALL)*/
  83. #define NW_PBURST              4  /* returns nuint16  = 1 if pburst (VLM) */
  84. #define NW_VERSION             8  /* returns nuint16  (VLM)  */
  85. #define NW_HARD_COUNT          9  /* returns WORD (VLM)  */
  86. #define NW_CONN_NUM           13  /* returns nuint16  (ALL)  */
  87. #define NW_TRAN_TYPE          15  /* returns nuint16  (VLM)  */
  88. #define NW_TRAN_IPX       0x0021
  89. #define NW_TRAN_TCP       0x0022
  90. #define NW_SESSION_ID     0x8000  /* returns nuint16) (VLM) */
  91. #define NW_SERVER_ADDRESS 0x8001  /* returns 12 byte address (ALL) */
  92. #define NW_SERVER_NAME    0x8002  /* returns 48 byte string  (ALL) */
  93.  
  94. /* New connection model calls. */
  95.  
  96. /* Maximum defines */
  97. #define NW_MAX_USER_NAME_LEN             48
  98. #define NW_MAX_SERVER_NAME_LEN           48
  99. #define NW_MAX_TREE_NAME_CHARS           32
  100. #define NW_MAX_TRAN_ADDR_LEN             30
  101. #define NW_MAX_SERVICE_TYPE_LEN          28
  102. #define NW_MAX_WORKGROUP_NAME_LEN        16
  103. #define NW_MAX_PNW_USER_NAME_LEN         16
  104. #define NW_MAX_NET_ADDR_LEN              128
  105.  
  106. /* Name Format Type (nuint value) */
  107. #define NWCONN_NAME_FORMAT_NDS           0x0001
  108. #define NWCONN_NAME_FORMAT_BIND          0x0002
  109. #define NWCONN_NAME_FORMAT_BDP           0x0004
  110. #define NWCONN_NAME_FORMAT_NDS_TREE      0x0008
  111.  
  112. /* Open connection flags - (nuint value) */
  113. #define NWCONN_FLAGS_LICENSED            0x0001
  114. #define NWCONN_FLAGS_UNLICENSED          0x0002
  115.  
  116.  
  117. NWCCODE N_API NWOpenConnByName
  118. (
  119.    NWCONN_HANDLE         startConnHandle,
  120.    pnstr8                pName,
  121.    nuint                 nameFormat,
  122.    nuint                 connFlags,
  123.    NWCONN_HANDLE N_FAR * pConnHandle
  124. );
  125.  
  126. NWCCODE N_API NWCloseConn
  127. (
  128.    NWCONN_HANDLE  connHandle
  129. );
  130.  
  131. NWCCODE N_API NWSysCloseConn
  132. (
  133.    NWCONN_HANDLE  connHandle
  134. );
  135.  
  136. NWCCODE N_API NWSetPrimaryConn
  137. (
  138.    NWCONN_HANDLE connHandle
  139. );
  140.  
  141. /* End of new connection model calls. */
  142.  
  143. NWCCODE N_API NWGetConnInfo
  144. (
  145.    NWCONN_HANDLE  connHandle,
  146.    nuint16        type,
  147.    nptr           pData
  148. );
  149.  
  150. NWCCODE N_API NWLockConnection
  151. (
  152.    NWCONN_HANDLE connHandle
  153. );
  154.  
  155. NWCCODE N_API NWGetConnectionUsageStats
  156. (
  157.    NWCONN_HANDLE  connHandle,
  158.    NWCONN_NUM     connNumber,
  159.    CONN_USE N_FAR * pStatusBuffer
  160. );
  161.  
  162. NWCCODE N_API NWGetConnectionInformation
  163. (
  164.    NWCONN_HANDLE  connHandle,
  165.    NWCONN_NUM     connNumber,
  166.    pnstr8         pObjName,
  167.    pnuint16       pObjType,
  168.    pnuint32       pObjID,
  169.    pnuint8        pLoginTime
  170. );
  171.  
  172. NWCCODE N_API NWGetInternetAddress
  173. (
  174.    NWCONN_HANDLE connHandle,
  175.    NWCONN_NUM    connNumber,
  176.    pnuint8       pInetAddr
  177. );
  178.  
  179. NWCCODE N_API NWGetInetAddr
  180. (
  181.    NWCONN_HANDLE  connHandle,
  182.    NWCONN_NUM     connNum,
  183.    NWINET_ADDR N_FAR * pInetAddr
  184. );
  185.  
  186. void N_API NWGetMaximumConnections
  187. (
  188.    pnuint16    pMaxConns
  189. );
  190.  
  191. NWCCODE N_API NWGetConnectionList
  192. (
  193.    nuint16        Mode,
  194.    NWCONN_HANDLE N_FAR * connListBuffer,
  195.    nuint16        connListSize,
  196.    pnuint16       pNumConns
  197. );
  198.  
  199. NWCCODE N_API NWGetConnectionStatus
  200. (
  201.    NWCONN_HANDLE        connHandle,
  202.    CONNECT_INFO N_FAR * pConnInfo,
  203.    nuint16              connInfoSize
  204. );
  205.  
  206. NWCCODE N_API NWGetConnectionNumber
  207. (
  208.    NWCONN_HANDLE        connHandle,
  209.    NWCONN_NUM N_FAR *   connNumber
  210. );
  211.  
  212. NWCCODE N_API NWClearConnectionNumber
  213. (
  214.    NWCONN_HANDLE  connHandle,
  215.    NWCONN_NUM     connNumber
  216. );
  217.  
  218. NWCCODE N_API NWGetDefaultConnRef
  219. (
  220.    pnuint32 pConnReference
  221. );
  222.  
  223. NWCCODE N_API NWGetDefaultConnectionID
  224. (
  225.    NWCONN_HANDLE N_FAR * pConnHandle
  226. );
  227.  
  228. #define NWGetConnectionID(a, b, c, d) NWGetConnectionHandle(a, b, c, d)
  229.  
  230. NWCCODE N_API NWGetConnectionHandle
  231. (
  232.    pnuint8        pServerName,
  233.    nuint16        reserved1,
  234.    NWCONN_HANDLE N_FAR * pConnHandle,
  235.    pnuint16       reserved2
  236. );
  237.  
  238. NWCCODE N_API NWSetPrimaryConnectionID
  239. (
  240.    NWCONN_HANDLE connHandle
  241. );
  242.  
  243. NWCCODE N_API NWGetPrimaryConnectionID
  244. (
  245.    NWCONN_HANDLE N_FAR * pConnHandle
  246. );
  247.  
  248. NWCCODE N_API NWGetObjectConnectionNumbers
  249. (
  250.    NWCONN_HANDLE        connHandle,
  251.    pnstr8               pObjName,
  252.    nuint16              objType,
  253.    pnuint16             pNumConns,
  254.    NWCONN_NUM N_FAR *   pConnHandleList,
  255.    nuint16              maxConns
  256. );
  257.  
  258. NWCCODE N_API NWGetConnListFromObject
  259. (
  260.    NWCONN_HANDLE  connHandle,
  261.    nuint32        objID,
  262.    nuint32        searchConnNum,
  263.    pnuint16       pConnListLen,
  264.    pnuint32       pConnList
  265. );
  266.  
  267. #ifndef NWOS2
  268. NWCCODE N_API NWIsIDInUse
  269. (
  270.    NWCONN_HANDLE connHandle
  271. );
  272.  
  273. NWCCODE N_API NWGetPreferredServer
  274. (
  275.    NWCONN_HANDLE N_FAR * pConnHandle
  276. );
  277.  
  278. NWCCODE N_API NWSetPreferredServer
  279. (
  280.    NWCONN_HANDLE connHandle
  281. );
  282.  
  283. #else
  284. NWCCODE N_API NWResetConnectionConfig
  285. (
  286.    nuint32  flags
  287. );
  288. #endif
  289.  
  290. #ifdef __cplusplus
  291. }
  292. #endif
  293.  
  294. #include "npackoff.h"
  295. #endif
  296.